<?php

if ( is($_GET['act'])=='edit' ) {
  $tmp = new Form();
  if ( page::$method=='POST' && is($_POST['name']) ) {
    Config::set( $_POST['name'], is($_POST['value']) );
    Config::save();
    $tmp->message = '<p>Property saved</p>';
  }
  $name = isor(is($_POST['name']), is($_GET['name']));
  $tmp->str( 'Property name', 'name',  $name );
  $tmp->str( 'Value',         'value', isor(Config::get($name), is($_POST['value']) ) );
  $tmp->submit( is($_GET['name'], 'Save', 'Create') );
} else {
  if ( $del = is($_GET['delete']) ) {
    Config::uset($del);
  }
  $tmp = new Template('pan_config');
}

page::$html->assign( 'content', $tmp );